package org.cuijq.thinking.in.spring.dependency.lookup;

import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author by CuiJQ
 * @Classname BeanInstantiationExceptionDemo
 * @Description BeanInstantiationExceptionDemo Description
 * @Date 2021/6/28 20:22
 */
public class BeanInstantiationExceptionDemo {
  public static void main(String[] args) {
    AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext();
    BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder.genericBeanDefinition(CharSequence.class);
    ac.registerBeanDefinition("errorBean",beanDefinitionBuilder.getBeanDefinition());
    ac.refresh();
    ac.close();
  }
}
